package com.javaGather.demo3;

import java.util.HashMap;
import java.util.LinkedHashMap;

public class Test4 {
    public static void main(String[] args) {
        /**
         * LinkedHashMap 保证有序
         * 通过双向链表记录存入顺序，遍历时通过双向链表进行遍历
         *
         */
        LinkedHashMap<Student, String> linkedHashMap = new LinkedHashMap<>();

        /**
         * key:学生对象
         * value：手机号
         */
        linkedHashMap.put(new Student("Jack",22),"110");
        linkedHashMap.put(new Student("Tom",22),"120");
        linkedHashMap.put(new Student("Jack1",22),"120");
        linkedHashMap.put(new Student("Jack2",22),"120");
        linkedHashMap.put(new Student("Jack3",22),"120");
        System.out.println(linkedHashMap.size());




    }
}
